package g4p.tests;

import g4p_controls.G4P;
import g4p_controls.GButton;
import g4p_controls.GCScheme;
import g4p_controls.GEvent;
import g4p_controls.GPanel;
import processing.core.PApplet;

public class NestedPanel01 extends PApplet {

	public void setup(){
		  size(480, 320);
		  createGUI();
		  customGUI();
		  // Place your setup code here
		}

		public void draw(){
		  background(230);
		  
		}

		// Use this method to add additional statements
		// to customise the GUI controls
		public void customGUI(){

		}
		
		public void handleButtonEvents(GButton button, GEvent event) { 
			System.out.println("Button clicked");
		}

		public void panel1_Click1(GPanel source, GEvent event) { //_CODE_:panel1:368988:
//		  println(source);
		} //_CODE_:panel1:368988:

		public void panel2_Click1(GPanel source, GEvent event) { //_CODE_:panel2:615680:
//		  println(source);
		} //_CODE_:panel2:615680:



		// Create all the GUI controls. 
		// autogenerated do not edit
		public void createGUI(){
		  G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
		  G4P.messagesEnabled(false);
		  G4P.setCursor(ARROW);
		  if(frame != null)
		    frame.setTitle("Sketch Window");

		  panel1 = new GPanel(this, 80, 60, 200, 140, "Tab bar text");
		  panel1.tag="Panel1";
		  panel1.setCollapsed(false);
		  panel1.addEventHandler(this, "panel1_Click1");

		  panel2 = new GPanel(this, 10, 20, 140, 80, "Tab bar text");
		  panel2.tag="Panel2";
//		  panel2.setCollapsed(false);
		  panel2.addEventHandler(this, "panel2_Click1");
		  panel1.addControl(panel2, 10, 20 ,0);
		  panel2.setLocalColorScheme(G4P.RED_SCHEME);

		  btn1 = new GButton(this,10,20,60,20,"X");
		  panel2.addControls(btn1);
		}

		// Variable declarations 
		// autogenerated do not edit
		GPanel panel1; 
		GPanel panel2; 
		GButton btn1;
}
